PwrDown is a system extension that allows you to shut down or restart your Macintosh from the keyboard, rather than going to all the trouble of using the menu command in Finder.
Installation
To use PwrDown, drag its icon into the system folder and allow Finder to place it in the Extensions folder. Alternatively, you can drag it to the extensions folder directly. You must then restart your Macintosh for PwrDown to become active.
Requirements
PwrDown requires System 7.0, or later, and a keyboard with a Reset (aka Power) button. This is the key with an embossed triangle near its left edge.
Use
Once PwrDown has been installed, simply press Control-Power to shut down or Control-Option-Power to restart.
“But wait,” I hear you cry, “those key combinations are used by PwrSwitcher.”
Well, you’re right.
Some programs, like Excel, simulate key presses of the Power key both alone and with various modifier keys down. I would assume this is done for internal communication of some sort, although why they didn’t use Apple Events is beyond my comprehension (you gotta love Microsoft). But I digress…. Anyway, the Control key is unused for their purposes so to prevent unexplained key presses from arising while running a program such as this, I require the Control key to be down. The Control key is used in PwrSwitcher for similar reasons (according to PwrSwitcher’s documentation).
For those of you who use PwrSwitcher, I have included a second version of the PwrDown extension, called “PwrDown for PwrSwitcher”, which uses Command-Control-Shift-Power to shut down and Command-Control-Shift-Option-Power to restart.
I realize that these four- and five-key combinations are somewhat cumbersome (to say the least) but I wanted to maintain consistent meaning of the Option key (meaning adding the Option modifier to the shut down key combination causes a restart) and some Macintosh models, like the LC, use Command-Control-Power as the hardware restart switch since they lack a physical restart switch on the computer case. Thus, with Command-Control-Power used by the System and all combinations of the Control, Option, and Shift keys used by PwrSwitcher, I used the only remaining choice.
Perhaps if you convince David Lamkins (author of PwrSwitcher) and myself to allow user-selectable modifier keys (see Possible Future Enhancements, below) this problem can be avoided.
PwrDown sends Apple Events to the Finder to perform its functions. This has four consequences. First, it means that using PwrDown is exactly like choosing “Shut Down” or “Restart” from the “Special” menu in Finder: you are given the opportunity to save any unsaved documents, if any are open. Second, it means that you are given the opportunity to cancel the shut down or restart if any unsaved documents are open. Third, it means that PwrDown requires System 7.0 or greater. Finally, it means that if you attempt to shut down or restart while the front window is a modal dialog, normal operation will continue until the modal dialog is removed and then the shut down or restart will occur. This is because background processes are not given processing time during calls to _ModalDialog.
Compatibility
PwrDown has been tested on a Mac IIci, an LC, an LCII, a IIsi, and a Classic, all running System 7.0.1 with Tuner 1.1.1 and a host of other Extensions (if you use AfterDark, see Known Problems, below).
Possible Enhancements For The Future
If enough people are interested in (read: E-mail me about) these, or other, improvements I will work on them.
1. Add Control Panel interface to allow activation and deactivation of
PwrDown, along with allowing the user to specify which key combinations
perform each function.
2. Automatic disabling of shut down and restart while the front window is a
modal dialog.
3. Fix the AfterDark problem described below.
Known Problems
If a shut down or restart is attempted while AfterDark is running, AfterDark will not release the display unless there are unsaved documents to be dealt with or there is an application that needs to be terminated. This is fine for restarting all Macs and for shutting down Macs like the IIci which will physically be turned off by the shut down command. The problem comes when you shut down a Mac that displays the shut down dialog and makes the user flip a power switch to turn the power off. If the above conditions for making AfterDark release the display are not met (i.e. if only the Finder is running) and you shut down the Mac with PwrDown, the shut down dialog will appear behind the AfterDark module. The upshot is AfterDark stops processing (freezes) and you do not see the shut down dialog. The dialog is there (and if you press the mouse button with the cursor over the location of the “Restart” button that appears on this dialog, your machine will restart) and it is safe to flip the power switch, it just looks remarkably like a system crash.
This behavior may exist with other screen savers.
It was not dealt with because I want to write code that will deactivate any screen saver that is running (as opposed to writing a piece of code specific to AfterDark) and because I could not find a simple way to deactivate a screen saver that would have no other consequences.
Shareware Info
If you find PwrDown useful, I would appreciate receiving a check for $5 at the address below.
Chris Larson
7009 Morton Ct.
Stockton, CA 95219-3134
Bug Reports, Suggestions, etc. to:
internet: ez028852@bullwinkle.ucdavis.edu
Disclaimer & Other Legal Stuff
I have attempted to make PwrDown as error free as possible (and will continue to do so) but I make no warranty, either implied or stated, as to the functioning of this product. By using PwrDown, the user assumes all responsibility for all loss resulting, either directly or indirectly, from its use.
I reserve all rights to PwrDown. Any redistribution must include this file and there must be no cost for the redistribution beyond modem connect time or reasonable disk-duplication charges.
All trademarks used herein are property of their respective owners.